// 操作符枚举
export enum FilterOperate {
  AND = 1, // 逻辑与&&
  OR = 2, //逻辑或||
  EQUAL_TO = 3, // 等于
  NOT_EQUAL_TO = 4, // 不等于
  LESS_THAN = 5, // 小于
  LESS_THAN_EQUAL_TO = 6, // 小于等于
  GREATER_THAN = 7, // 大于
  GREATER_THAN_EQUAL_TO = 8, // 大于等于
  START_AT = 9, // 开始于
  END_AT = 10, // 结束于
  CONTAIN = 11, // 包含
  NOT_CONTAIN = 12, // 不包含
  START_OR_REVERT_AT = 13, // 以...开始或以反转开始
}

// filter rule
export class FilterRule {
  field: string;
  value: any;
  operate: FilterOperate;
}

// filter group
export class FilterGroup {
  rules: FilterRule[];
  operate: FilterOperate = FilterOperate.AND;
}

// filter
export class Filter {
  rules: FilterRule[];
  groups: FilterGroup[];
  operate: FilterOperate = FilterOperate.AND;
}
